import { request } from "./request";

export function getsonglist(id) {
  return request({
    url: '/playlist/detail',
    params: {
      id: id
    }
  }) 
}
//获取音乐url
export function getsongurlapi(id) {
  return request({
    url: '/song/url',
    params: {
      id: id
    }
  })
}
//音乐信息
export function getsongfinfoapi(id) {
  return request({
    url: '/song/detail',
    params: {
      ids: id
    }
  })
}

//歌单评论
export function getcommenthot(id,type) {
  return request({
    url: '/comment/hot',
    params: {
      id: id,
      type:type
    }
  })
}


//搜索歌曲
export function getseach(type,offset,keywords) {
  return request({
    url: '/cloudsearch',
    params: {
      type: type,
      offset: offset,
      keywords: keywords
    }
  })
}


//获取视频地址
export function getvideoapi(id) {
  return request({
    url: '/video/url',
    params: {
      id:id
    }
  })
}
//获取MV地址
export function getmvapi(id) {
  return request({
    url: '/mv/url',
    params: {
      id:id
    }
  })
}

export function getbanner() {
  return request({
    url: '/banner?type=0'
  })
}


/* export class UserInfo {
  constructor(userinfo) {  
    //用户名字
    this.nickname = userinfo.data.profile.nickname
    //用户头像
    this.avatarUrl = userinfo.data.profile.avatarUrl
  } 
} */